//
//  GoodsCollectionViewCell.m
//  Wedding fantastic
//
//  Created by dllo on 15/6/30.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "GoodsCollectionViewCell.h"

#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height

@implementation GoodsCollectionViewCell
- (void)dealloc
{
    [_topImageView release];
    [_priceLabel release];
    [_recommendLabel release];
    [_imageView release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 120 * HEIGHT / 667)];
        self.topImageView.layer.masksToBounds = YES;
        self.topImageView.layer.cornerRadius = 10;
        [self.contentView addSubview:self.topImageView];
        [_topImageView release];
        
        self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(5 * WIDTH / 375, 135 * HEIGHT / 667, 80 * WIDTH / 375, 20 * HEIGHT / 667)];
        self.priceLabel.font = [UIFont systemFontOfSize:15.0];
        [self.contentView addSubview:self.priceLabel];
        [_priceLabel release];
        
        self.recommendLabel = [[UILabel alloc] initWithFrame:CGRectMake(120 * WIDTH / 375, 135 * HEIGHT / 667, 40 * WIDTH / 375, 20 * HEIGHT / 667)];
        self.recommendLabel.font = [UIFont systemFontOfSize:14];
        self.recommendLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.recommendLabel];
        [_recommendLabel release];
        
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(90 * WIDTH / 375, 135 * HEIGHT / 667, 20 * WIDTH / 375, 20 * HEIGHT / 667)];
        self.imageView.image = [UIImage imageNamed:@"collection"];
        [self.contentView addSubview:self.imageView];
        [_imageView release];
    }
    return self;
}

@end
